import request from '@/utils/request'

// 数据字典-获取分页
export function zxDatadictPage(params) {
  return request({
    url: 'zxDatadict/page',
    method: 'POST',
    data: params
  })
}

// 数据字典-编辑
export function zxDatadictUpdate(params) {
  return request({
    url: '/zxDatadict/update',
    method: 'POST',
    data: params
  })
}

// 数据字典项-获取分页
export function zxDataentryPage(params) {
  return request({
    url: 'zxDataentry/page',
    method: 'POST',
    data: params
  })
}
// 数据字典项-删除
export function zxDataentryDelete(id) {
  return request({
    url: `zxDataentry/delete/${id}`,
    method: 'delete'
  })
}
// 数据字典项-新增
export function zxDataentrySave(params) {
  return request({
    url: 'zxDataentry/save',
    method: 'POST',
    data: params
  })
}
// 数据字典项-编辑
export function zxDataentryUpdate(params) {
  return request({
    url: 'zxDataentry/update',
    method: 'PUT',
    data: params
  })
}

// 数据字典项-启用
export function zxDataentryUnEnable(params) {
  return request({
    url: 'zxDataentry/unEnable',
    method: 'post',
    data: params
  })
}
// 数据字典项-下载
export function zxDataentryDownload(param) {
  return request({
    url: `/zxDataentry/download/${param.isMoBan}/${param.dictCode}?entryName=${param.entryName}`,
    method: 'post',
    responseType: 'blob'
  })
}

// 数据字典项-导入

export function zxDataentrySaveFile(param) {
  return request({
    url: `/zxDataentry/saveFile`,
    method: 'post',
    data: param.formData
  })
}

// 费用类别-分页

export function zxExpenseTypePage(param) {
  return request({
    url: `/zxExpenseType/page`,
    method: 'post',
    data: param
  })
}
// 费用类别-删除

export function zxExpenseDelete(param) {
  return request({
    url: `/zxExpenseType/delete/${param.id}`,
    method: 'delete'
  })
}

// 费用类别-下拉框

export function getEntryByDictId(dictCode) {
  return request({
    url: `/zxDataentry/getEntryByDictId/${dictCode}`,
    method: 'get'
  })
}

// 费用类别-下载
export function zxExpenseDownload(param) {
  return request({
    url: `/zxExpenseType/download/${param.isMuBan}`,
    method: 'post',
    responseType: 'blob',
    data: param.entity
  })
}

// 费用类别-导入
export function zxExpenseTypeSaveFile(param) {
  return request({
    url: `/zxExpenseType/saveFile`,
    method: 'post',
    data: param.formData
  })
}

// 费用类别-编辑

export function zxExpenseTypeSaveOrUpdate(param) {
  return request({
    url: `/zxExpenseType/saveOrUpdate`,
    method: 'post',
    data: param
  })
}

// 项目信息管理-列表

export function projectInfoPage(param) {
  return request({
    url: `/sync`,
    method: 'post',
    data: param
  })
}

// 项目信息管理-删除

export function projectInfoDelete(param) {
  return request({
    url: `/delete_project?code=${param.code}`,
    method: 'delete'
  })
}

// 项目信息管理-编辑

export function projectInfoUpdate(param) {
  return request({
    url: `/update_project`,
    method: 'post',
    data: param
  })
}
// 项目信息管理-项目负责人

export function projectInfoLeader(param) {
  console.log('param', param)
  return request({
    url: `/get_leader?userName=${param.userName}`,
    method: 'get'
  })
}

// 项目信息管理-项目类别

export function projectInfoType(param) {
  return request({
    url: `/project_type?type=${param.type}`,
    method: 'get'
  })
}

// 项目信息管理-科室列表

export function projectInfoDept(param) {
  return request({
    url: `/project_root_dept`,
    method: 'get'
  })
}

// 项目信息管理-下载模板
export function projectInfoDownloadex(param) {
  return request({
    url: `/download_ex`,
    method: 'post',
    responseType: 'blob',
    data: param
  })
}

// 项目信息管理-导出
export function projectInfoDownload(param) {
  return request({
    url: `/download`,
    method: 'post',
    responseType: 'blob',
    data: param
  })
}

// 项目信息管理-导入

export function projectInfoImport(param) {
  return request({
    url: `/import`,
    method: 'post',
    data: param
  })
}

// 项目信息管理-详情

export function getProjectDetail(param) {
  return request({
    url: `/getProjectDetail?financialCode=${param.financialCode}`,
    method: 'get'
  })
}

// 项目信息管理-采集项目数据

export function collectFinancialData(param) {
  return request({
    url: `/collectFinancialData`,
    method: 'get'
  })
}

// 项目信息管理-采集单月凭证数据

export function CollectVoucherData(param) {
  return request({
    url: `zxEtlAccountInfo/CollectVoucherData?year=${param.year}&month=${param.month}`,
    method: 'get'

  })
}

// 项目信息管理-导入分批经费

export function importAllocation(param) {
  return request({
    url: `/importAllocation`,
    method: 'post',
    data: param
  })
}

// 项目档案-分页

export function archivesqueryForPage(param) {
  return request({
    url: `/zxSumMoney/queryForPage`,
    method: 'post',
    data: param
  })
}

// 项目档案-明细-下

export function queryAllProjectDetail(param) {
  return request({
    url: `/zxSumMoney/queryAllProjectDetail`,
    method: 'post',
    data: param
  })
}

// 项目档案-明细-上

export function queryAllProjectDetailOn(param) {
  return request({
    url: `/zxSumMoney/queryAllProjectDetailOn`,
    method: 'post',
    data: param
  })
}

// 项目档案-导出-外

export function archivesqueryDownloadAllProject(param) {
  return request({
    url: `/zxSumMoney/downloadAllProject`,
    method: 'post',
    responseType: 'blob',
    data: param
  })
}

// 项目档案-导出-内

export function downloadAllDetailProject(param) {
  return request({
    url: `/zxSumMoney/downloadAllDetailProject`,
    method: 'post',
    responseType: 'blob',
    data: param
  })
}

// 项目查询-分页

export function XmcxqueryForPage(param) {
  return request({
    url: `/zxProjectSelect/queryForPage`,
    method: 'post',
    data: param
  })
}

// 项目查询-导出-外

export function xmcxdownloadAllProject(param) {
  return request({
    url: `/zxProjectSelect/downloadAllProject`,
    method: 'post',
    responseType: 'blob',
    data: param
  })
}

// 项目查询-导出-内

export function downloadAllXmcxDetailProject(param) {
  return request({
    url: `/zxProjectSelect/downloadAllDetailProject`,
    method: 'post',
    responseType: 'blob',
    data: param
  })
}

// 项目查询-明细-上

export function queryAllProjectXmcxDetailOn(param) {
  return request({
    url: `/zxProjectSelect/queryAllProjectDetailOn`,
    method: 'post',
    data: param
  })
}

// 项目查询-明细-下

export function queryAllProjectXmcxDetailDown(param) {
  return request({
    url: `/zxProjectSelect/queryAllProjectDetailDown`,
    method: 'post',
    data: param
  })
}

// 删除审核管理-分页

export function scshGetList(param) {
  return request({
    url: `/getList`,
    method: 'post',
    data: param
  })
}

// 删除审核管理-分页

export function scshauditOperation(param) {
  return request({
    url: `/auditOperation`,
    method: 'post',
    data: param
  })
}

// 项目申诉记录-新建

export function saveProjectAppeal(param) {
  return request({
    url: `/zxProjectAppeal/saveProjectAppeal`,
    method: 'post',
    data: param
  })
}

// 项目申诉记录-分页

export function pageForZxProjectAppeal(param) {
  return request({
    url: `/zxProjectAppeal/pageForZxProjectAppeal`,
    method: 'post',
    data: param
  })
}

// 项目申诉记录-查询项目申诉记录基本信息

export function queryZxProjectAppealForDetail(param) {
  return request({
    url: `/zxProjectAppeal/queryZxProjectAppealForDetail`,
    method: 'post',
    data: param
  })
}

// 项目申诉记录-编辑

export function editZxProjectAppeal(param) {
  return request({
    url: `/zxProjectAppeal/editZxProjectAppeal`,
    method: 'post',
    data: param
  })
}

// 项目申诉记录-撤回项目申诉记录信息

export function deleteZxProjectAppeal(param) {
  return request({
    url: `/zxProjectAppeal/deleteZxProjectAppeal/${param.id}`,
    method: 'delete'
  })
}

// 项目申诉处理-分页

export function pageForZxDealProjectAppeal(param) {
  return request({
    url: `/zxProjectHandleAppeal/pageForZxProjectAppeal`,
    method: 'post',
    data: param
  })
}

// 项目申诉处理-查询项目申诉记录基本信息

export function queryZxDealProjectAppealForDetail(param) {
  return request({
    url: `/zxProjectHandleAppeal/queryZxProjectAppealForDetail`,
    method: 'post',
    data: param
  })
}

// 项目申诉处理-处理

export function alreadyEditForZxProjectAppeal(param) {
  return request({
    url: `/zxProjectHandleAppeal/alreadyEditForZxProjectAppeal`,
    method: 'put',
    data: param
  })
}
// 项目申诉处理-查询未处理的数量,0表示没有

export function getNoHandleNum(param) {
  return request({
    url: `/zxProjectHandleAppeal/getNoHandleNum`,
    method: 'get'
  })
}

// 审核人设置-查询所有用户

export function getAllUser(param) {
  return request({
    url: `/zxAuth/getAllUser`,
    method: 'post',
    data: param
  })
}

// 审核人设置-新增审批用户

export function insertZxAuth(param) {
  return request({
    url: `/zxAuth/insertZxAuth`,
    method: 'post',
    data: param
  })
}
// 审核人设置-查询新增用户

export function getAllHandleUser(param) {
  return request({
    url: `/zxAuth/getAllHandleUser`,
    method: 'get'
  })
}

// 专项经费-系统设置-项目类别配置-分页列表
export function mainPage(param) {
  return request({
    url: '/zxUserProjectRelation/mainPage',
    method: 'post',
    data: param
  })
}

// 专项经费-系统设置-项目类别配置-项目类别下拉框
export function projectList(param) {
  return request({
    url: '/zxUserProjectRelation/projectList',
    method: 'get'
  })
}

// 专项经费-系统设置-项目类别配置-分页列表
export function userList(param) {
  return request({
    url: '/zxUserProjectRelation/userList',
    method: 'post',
    data: param
  })
}

// 专项经费-系统设置-项目类别配置-新增
export function save(param) {
  return request({
    url: '/zxUserProjectRelation/save',
    method: 'post',
    data: param
  })
}

// 专项经费-系统设置-项目类别配置-删除
export function removeById(id) {
  return request({
    url: `/zxUserProjectRelation/removeById?id=${id}`,
    method: 'delete'
  })
}
